<?php
$host = 'lamp-mysql';
$user = 'root';
$pwd = '123456';
$db = 'mysql';
$mysqli = new mysqli($host, $user, $pwd, $db);
if ($mysqli->connect_errno) {
echo "Errno: " . $mysqli->connect_errno . "\n";
}
echo "right";
$sql = 'SELECT * FROM users';
if ($res = $mysqli->query($sql)) {
while ($row = $res->fetch_assoc()) {
print_r($row);
}
}
?>
